package edu.zqu.specialty.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class SwaggerConfig {

    //为API配置分组：专业分组
    @Bean
    public Docket docketSpecialty() {
        return new Docket(DocumentationType.SWAGGER_2)
                //为分组起名字
                .groupName("专业模块")
                .select()
                //指定要扫描的包
                .apis(RequestHandlerSelectors.basePackage("edu.zqu.specialty.project.controller"))
                //该分组只显示/project/specialty/**路径下的
//                .paths(PathSelectors.ant("/specialty/**"))
                .build();
    }
}
